import 'package:mall/core/models/cart_list.dart';
import 'package:mall/core/models/product_detail.dart';
import 'package:json_annotation/json_annotation.dart';

part 'order_confirm.g.dart';

@JsonSerializable()
class OrderConfirm {
  final OrderConfirmAddress defaultAddress;
  final List<Store> carts;
  final List<Price> totalPriceVos;
  final Map<String, String> payModes;
  final String orderDesc;

  OrderConfirm(
    this.defaultAddress,
    this.carts,
    this.totalPriceVos,
    this.payModes,
    this.orderDesc,
  );

  factory OrderConfirm.fromJson(Map<String, dynamic> json) => _$OrderConfirmFromJson(json);

  Map<String, dynamic> toJson() => _$OrderConfirmToJson(this);
}

@JsonSerializable()
class OrderConfirmAddress {
  final int id;
  final String linkMan;
  final String contactPhone;
  final String fullAddress;

  OrderConfirmAddress(
    this.id,
    this.linkMan,
    this.contactPhone,
    this.fullAddress,
  );

  factory OrderConfirmAddress.fromJson(Map<String, dynamic> json) =>
      _$OrderConfirmAddressFromJson(json);

  Map<String, dynamic> toJson() => _$OrderConfirmAddressToJson(this);
}
